<%-- 
    Document   : testDataSource
    Created on : 2011. 12. 7, 오전 2:19:11
    Author     : The Lunatics
--%>
<%@page import="service.LoginsFacadeREST"%>
<%@page import="controllers.LoginsJpaController"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>DB Report</h1>
        <!-- SEE THE TUTORIAL 
        http://netbeans.org/kb/docs/javaee/ecommerce/connect-db.html#testConnPoolDataSource -->

        <%-- <sql:query var="result" dataSource="jdbc/peacle-project/localhost/jihhwang">
             SELECT * 
             FROM users
     </sql:query> --%>

        <jsp:useBean id="dataBean" class="LoginsFacadeREST" scope="page">
        </jsp:useBean>


        <table border="1">
            <!-- column headers -->
            <tr>
                <c:forEach var="columnName" items="${columnNames}">
                    <th><c:out value="${columnName}"/></th>
                </c:forEach>
            </tr>
            <!-- column data -->
            <c:forEach var="row" items="${rowsByIndex}">
                <tr>
                    <c:forEach var="column" items="${row}">
                        <td><c:out value="${userId}"/></td>
                    </c:forEach>
                </tr>
            </c:forEach>
        </table>
    </body>
</html>
